Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Streamline event emission and tracking #154

Merged
merged 1 commit into from
Oct 1, 2020

Conversation

aldesantis
Copy link
Member

Improves the flow followed by the extension when firing and tracking events.

Previously, a SubscriptionEvent record would be created first, which would then fire a Spree::Event in an after_create callback. This wasn't a very intuitive flow and it didn't follow the conventions used in the core.

Now, a Spree::Event is fired first thing. Then, a subscriber catches all events fired by this extension and saves them as a SubscriptionEvent record under the related subscription.

Using the built-in subscriber mechanism streamlines how we handle events and makes it more consistent with the core.

@aldesantis aldesantis added enhancement Improves an existing feature. breaking Introduces a breaking change. labels Oct 1, 2020
@aldesantis aldesantis self-assigned this Oct 1, 2020
@aldesantis aldesantis merged commit db9fb49 into master Oct 1, 2020
@aldesantis aldesantis deleted the aldesantis/improve-events branch October 1, 2020 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Introduces a breaking change. enhancement Improves an existing feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant